package com.itheima_01.day08;

import java.util.Scanner;

public class KeHouZuoYe_01 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您的QQ号：");
        String s = sc.nextLine();
        PanDuanQQ(s);
    }

    public static void PanDuanQQ(String s) {
        StringBuilder sb = new StringBuilder(s);//String转StringBuilder
        if (s.length() >= 5 && s.length() <= 12) {
            if (sb.substring(0, 1).equals("0")) {//对字符进行比较
                System.out.println("您输入的QQ号首位不合法！");
            } else {
                System.out.println("您输入的QQ合法！");
            }
        } else {
            System.out.println("您输入的QQ号位数不合法！");
        }
        System.out.println(sb);
    }
}
